package br.patrimonio.inventario.entity;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Index;

import br.patrimonio.inventario.converter.BaseEntity;

@Entity
public class PrazoSetor implements Serializable, BaseEntity {
	
	private static final long serialVersionUID = 1L;
	
	@Id
	@Index(name="praz_id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="praz_id")
	private Long id;
	
	@ManyToOne
	@Index(name="fk_setor")
	@JoinColumn(name="fk_setor")
	private Setor setor;
	
	@Column(name="praz_status")
	private String status;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="praz_data_envio")
	private Date data_envio;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="praz_data_entrega")
	private Date prazo_entrega;
	
	@Temporal(TemporalType.DATE)
	@Column(name="praz_data_devolucao")
	private Calendar devolucao = Calendar.getInstance();
	
//	GETTERS AND SETTERS

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Setor getSetor() {
		return setor;
	}

	public void setSetor(Setor setor) {
		this.setor = setor;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}	

	public Date getData_envio() {
		return data_envio;
	}

	public void setData_envio(Date data_envio) {
		this.data_envio = data_envio;
	}

	public Date getPrazo_entrega() {
		return prazo_entrega;
	}

	public void setPrazo_entrega(Date prazo_entrega) {
		this.prazo_entrega = prazo_entrega;
	}

	public Calendar getDevolucao() {
		return devolucao;
	}

	public void setDevolucao(Calendar devolucao) {
		this.devolucao = devolucao;
	}

}
